CREATE TABLE [dbo].[Accounts]
(
[Id] [int] NOT NULL IDENTITY(1, 1),
[Name] [varchar] (max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AccountTypeId] [int] NULL,
[Status] [int] NULL,
[ActualBalance] [decimal] (18, 0) NULL,
[AvailableBalance] [decimal] (18, 0) NULL,
[CustomerId] [int] NULL,
[TimeStamp] [timestamp] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Accounts] ADD CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Accounts] ADD CONSTRAINT [FK_Accounts_AccountTypes] FOREIGN KEY ([AccountTypeId]) REFERENCES [dbo].[AccountTypes] ([Id])
GO
ALTER TABLE [dbo].[Accounts] ADD CONSTRAINT [FK_Account_Customers] FOREIGN KEY ([CustomerId]) REFERENCES [dbo].[Customers] ([Id])
GO
